package com.itheima.dao;

import com.itheima.pojo.Menu;
import com.itheima.pojo.Role;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Set;

public interface RoleMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(Role record);

    int insertSelective(Role record);

    Role selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(Role record);

    int updateByPrimaryKey(Role record);

    /**
     * 根据用户的id查询出用户对应的角色
     * @param id
     * @return
     */
    Set<Role> findByUserId(@Param("id") Integer id);

    Integer findByRoleId(@Param("username") String username);

    List<Menu> findOneMenu(@Param("id")Integer id);

    List<Menu> findTwoMenu(@Param("rid") Integer rid,@Param("id") Integer id);
}